import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/login/Login.vue'
import Content from '../components/layout/Content.vue'
import List from '../components/content/List.vue'
import Welcome from '@/components/layout/Welcome'

Vue.use(VueRouter)

const routes = [{
  path: '/',
  redirect: '/login'
}, {
  path: '/login',
  component: Login
}, {
  path: '/content',
  component: Content,
  meta: { requireAuth: true },
  children: [{
    path: '/index',
    component: Welcome
  }, {
    path: '/user/list',
    component: List
  }, {
    path: '/role/list',
    component: List
  }, {
    path: '/section/list',
    component: List
  }, {
    path: '/node/list',
    component: List
  }]
}]

const router = new VueRouter({
  routes
})

export default router
